//
//  XRmenuBaseView.h
//  XRmenu
//
//  Created by Gao Yan on 11-11-23.
//  Copyright 2011年 foxhis. All rights reserved.
//

#import "AllInclude.h"
#import "VideoPlayer.h"

#define kTagOfBgImage 100
#define kTagOfStartBT 110
#define kTagOfStartImgV 130
#define kTagOfStartLabel 150
#define kTagOfStartTableView 170
#define kTagOfStartVideo 190
#define kTagOfStartText 200

@interface XRmenuBaseView : UIView<UIGestureRecognizerDelegate, UITableViewDelegate, UITableViewDataSource, UITextViewDelegate> {
	NSDictionary *tabDict;
	NSIndexPath  *selectedIndex;
	NSDictionary *viewDict;
}

@property (nonatomic, retain) NSDictionary *tabDict;
@property (nonatomic, retain) NSIndexPath  *selectedIndex;
@property (nonatomic, retain) NSDictionary *viewDict;

-(id) initWithConfig:(NSDictionary*)cfg;							// 通用点的初始化方法
-(id) initWithFrame:(CGRect)frame Style:(NSString*)stylename;		// 以公共样式显示
-(id) initWithFrame:(CGRect)frame TapGesture:(BOOL)aTap SwipeGesture:(BOOL)aSwipe;		// 以公共样式显示，并带手势指定

-(id) initWithStyle:(NSString*)stylename ViewName:(NSString*)vname;						// 以指定样式的视图参数显示
-(id) initWithStyle:(NSString*)stylename DishSubViewName:(NSString*)vname;				// 以指定样式的视图参数显示Dish二级视图

-(void) loadAllObjectByConfig:(NSDictionary*)cfg;                                       // 绘制所有配置对象
-(void) setBackgroundProperty:(NSDictionary*)bdict;										// 已指定样式显示背景
-(void) setButtonsProperty:(NSArray*)bts;												// 以指定样式显示按钮
-(void) setImageViewsProperty:(NSArray *)imvs;
-(void) setVideoViewsProperty:(NSArray *)vds;
-(void) setLabelsProperty:(NSArray*)lbs;
-(void) setTableViewProperty:(NSDictionary*)tdict Frame:(CGRect)fr;
-(void) setTextViewProperty:(NSDictionary*)tdict WithContent:(NSString *)content;

#pragma mark 通过plist自动绘制的对象可由基类翻译
-(void) translateButtons:(NSArray*)bts;

#pragma mark 依据参数调整部分值
-(CGRect) adjustRectByBoxStyle:(NSString*)stylename Frame:(CGRect)fr;

#pragma mark 添加各类手势
- (void) add1fingerTap;		
- (void) add1fingerTopSwipe;
- (void) add1fingerDownSwipe;
- (void) add1fingerLeftSwipe;
- (void) add1fingerRightSwipe;
- (void) addPinch;
//UI Skin/default skin/Dish Main View/TopBar View
-(id)findNode:(NSDictionary*) aDic atPath:(NSString*)aPath;
-(id)findNode:(NSDictionary*) aDic withKey:(NSString*)aKey;


//给某个对象添加手势操作
-(void)attach1fingerTap:(UIView*)aView sel:(SEL)aSel;
@end